<form method="post" action="{% url 'logout' %}">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="Logout" />
    <input type="hidden" name="next" value="{% url 'dashboard' %}" />
</form>
